package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.DingtalkDutyDao;
import cn.topevery.garden.entity.po.DingtalkDuty;
import cn.topevery.garden.entity.query.DingtalkDutyQuery;
import cn.topevery.garden.entity.vo.DingtalkDutyVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 
 *
 * @author code-generate
 * @date 2021-09-02
 */
@Service
public class DingtalkDutyLogic extends BaseLogic<DingtalkDuty> {
    @Autowired
    DingtalkDutyDao dingtalkDutyDao;

    @Override
    public BaseEntityDao<DingtalkDuty, Integer> getDao() {
        return dingtalkDutyDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<DingtalkDutyVO> listPage(DingtalkDutyQuery query) {
        return dingtalkDutyDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        dingtalkDutyDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param dingtalkDuty 实体
     */
    public void saveOrUpdate(String userId, DingtalkDuty dingtalkDuty){
        dingtalkDutyDao.saveOrUpdate(userId,dingtalkDuty);
    }

    public void truncate() {
        dingtalkDutyDao.truncate();
    }

    public List<Map<String, Object>> selectAllDuty() {
        return dingtalkDutyDao.selectAllDuty();
    }
}
